package com.jcl.recruit.console.api.corp;

import com.jcl.core.common.page.PageResult;
import com.jcl.core.resp.ApiResponse;
import com.jcl.recruit.console.corp.service.ConsoleCorpService;
import com.jcl.recruit.console.vo.ConsoleCorpPageCondition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @ClassName ConsoleCorpController
 * @Author yyliu
 * @Date 2018/12/25 16:20
 * @Version 1.0
 **/
@RestController
@RequestMapping("/console/corp")
public class ConsoleCorpController {

    @Autowired
    private ConsoleCorpService consoleCorpService;

    @PostMapping("/pageList")
    public ApiResponse pageList(@RequestBody ConsoleCorpPageCondition condition) {
        PageResult result = consoleCorpService.pageResult(condition);
        return ApiResponse.success(result);
    }

    @GetMapping("/type/list")
    public ApiResponse pageList() {

        List<Map<String, Object>> list = consoleCorpService.selectList();
        return ApiResponse.success(list);
    }
}
